<template>
  <div class="NewsDetail">
    <!-- <van-nav-bar
      title=""
      left-arrow
      @click-left="backHome"
    /> -->
    <nav-bar></nav-bar>
    <div class="wrap">
      <div class="NewsDetail-title">
        {{ award.title }}
      </div>
      <div class="NewsDetail-note">
        <!-- <div class="source">来源：{{news.subhead}}</div>
        <span>|</span>
        <div class="date">{{news.createTime}}</div> -->
      </div>
      <div
        class="NewsDetail-content v-html-img"
        v-html="award.awardContent"
      ></div>
      <div class="awardInfo">
        <div class="awardInfoContent">
          <span>*</span>注：以上奖项如需申报，请使用电脑访问官方网站提交申请
        </div>
        <div class="awardInfoLink">官网地址：www.cbda1984.com</div>
      </div>
    </div>
  </div>
</template>

<script>
import navBar from "@/components/NavBar";
export default {
  components: {
    navBar,
  },
  name: "AwardDetail",
  data() {
    return {
      imgUrl: config.imgUrl,
      awardId: 0,
      award: {},
    };
  },
  methods: {
    backHome() {
      this.$router.back();
    },
    findAward(awardId) {
      this.$request({
        url: "/award/selectOneAward",
        method: "post",
        data: { awardId: awardId },
      }).then((rsp) => {
        if (rsp.code === 200) {
          this.award = rsp.data[0];
          this.award.awardAccessory = JSON.parse(this.award.awardAccessory);
        } else {
          this.$message.error(rsp.content);
        }
      });
    },
  },
  mounted() {
    this.awardId = this.$route.query.awardId;
    this.findAward(this.awardId);
  },
};
</script>

<style lang='scss'>
@import "../assets/css/base";

.NewsDetail {
  padding-bottom: 10px;
  &-title {
    margin-top: px2rem(46);
    font-size: px2rem(40);
    color: #000000;
    font-weight: 500;
    text-align: center;
  }
  &-note {
    margin-top: px2rem(20);
    margin-bottom: px2rem(35);
    color: #808080;
    font-size: px2rem(20);
    display: flex;
    & > span {
      padding-left: px2rem(10);
      padding-right: px2rem(10);
    }
  }
  &-content {
    & > img {
      width: 100%;
      border-radius: px2rem(5);
      margin-bottom: px2rem(20);
    }
    & > p {
      font-size: px2rem(24);
      color: #333333;
      line-height: 1.8;
      margin-bottom: px2rem(30);
    }
  }
  .awardInfo {
    font-size: px2rem(28);
    border-radius: px2rem(10);
    background-color: #f1f1f1;
    padding: px2rem(20);
    margin-bottom: px2rem(40);

    .awardInfoContent {
      line-height: px2rem(40);
    }
    .awardInfoLink {
      line-height: px2rem(40);
    }
  }
}
</style>
